/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.j4sc;

/**
 * The PartyInformationBuilder is used to construct a {@link PartyInformation}
 * instance using the builder pattern.
 * <p>
 * 
 * Below shows an example of its use
 * <p>
 * 
 * <code>
 * PartyInformation information = new PartyInformationBuilder()<br>
 * .withCalledPartyName("john doe")<br>
 * .withCalledPartyIdentifier("500501502")<br>
 * .createPartyInformation();
 * </code>
 * 
 * @author Raj Patel, Dariusz Lorenc
 */
public class PartyInformationBuilder {

    private PartyInformation information;

    public PartyInformationBuilder() {
        information = new PartyInformation();
    }

    public PartyInformation createPartyInformation() {
        return information;
    }

    public PartyInformationBuilder withCalledPartyName(String name) {
        information.setCalledPartyName(name);
        return this;
    }

    public PartyInformationBuilder withCalledPartyIdentifier(String identifier) {
        information.setCalledPartyIdentifier(identifier);
        return this;
    }

    public PartyInformationBuilder withCallingPartyName(String name) {
        information.setCallingPartyName(name);
        return this;
    }

    public PartyInformationBuilder withCallingPartyIdentifier(String identifier) {
        information.setCallingPartyIdentifier(identifier);
        return this;
    }

    public PartyInformationBuilder withCallingParty(String name, String identifier) {
        information.setCallingPartyName(name);
        information.setCallingPartyIdentifier(identifier);
        return this;
    }

    public PartyInformationBuilder withCalledParty(String name, String identifier) {
        information.setCalledPartyName(name);
        information.setCalledPartyIdentifier(identifier);
        return this;
    }
}
